package huawei;

import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Collectors;

public class Question6 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int cpuOneTimeMaxJob = scanner.nextInt();
        scanner.nextLine();
        scanner.nextLine();
        String jobs = scanner.nextLine();
        List<Integer> jobList = Arrays.stream(jobs.split(" ")).mapToInt(Integer::parseInt).boxed().collect(Collectors.toList());

        Question6 solution6 = new Question6();
        int resolve = solution6.resolve(cpuOneTimeMaxJob, jobList);
        System.out.println(resolve);

    }

    public int resolve(int cpuOneTimeMaxJob, List<Integer> jobList) {
        int exeSecond = 0;
        int yu = 0;
        for (int i = 0; i < jobList.size(); i++) {
            int curJobs = jobList.get(i) + yu;
            yu = curJobs > cpuOneTimeMaxJob ? curJobs - cpuOneTimeMaxJob : 0;
            exeSecond += 1;
        }

        while (yu > 0) {
            yu -= cpuOneTimeMaxJob;
            exeSecond += 1;
        }

        return exeSecond;
    }
}
